<template>
  <div style="padding: 20px; background-color: red">
    Son
    <button @click="bBar = !bBar">弹框</button>
    <!-- 传送到 body 里 -->
    <teleport to="#test">
      <div v-if="bBar">弹框~~~~~~~~</div>
    </teleport>
  </div>
</template>

<script>
import { ref } from 'vue'
export default {
  setup() {
    const bBar = ref(false)
    return {
      bBar,
    }
  },
}
</script>

<style lang="scss" scoped></style>
